package cn.crm.bean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * RightMaping entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "RIGHTMAPING", schema = "CRM")
public class RightMaping implements java.io.Serializable {

	// Fields

	private Integer mid;
	private User user;
	private Right right;
	private Boolean isok;
	private Boolean isno;
	private Boolean inherit;

	// Constructors

	/** default constructor */
	public RightMaping() {
	}

	/** minimal constructor */
	public RightMaping(Right right) {
		this.right = right;
	}

	/** full constructor */
	public RightMaping(User user, Right right, Boolean isok, Boolean isno,
			Boolean inherit) {
		this.user = user;
		this.right = right;
		this.isok = isok;
		this.isno = isno;
		this.inherit = inherit;
	}

	// Property accessors
	@SequenceGenerator(name = "generator",sequenceName="seq_rightMaping_mid")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "MID", unique = true, nullable = false, precision = 8, scale = 0)
	public Integer getMid() {
		return this.mid;
	}

	public void setMid(Integer mid) {
		this.mid = mid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USID")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "RID", nullable = false)
	public Right getRight() {
		return this.right;
	}

	public void setRight(Right right) {
		this.right = right;
	}

	@Column(name = "ISOK", precision = 1, scale = 0)
	public Boolean getIsok() {
		return this.isok;
	}

	public void setIsok(Boolean isok) {
		this.isok = isok;
	}

	@Column(name = "ISNO", precision = 1, scale = 0)
	public Boolean getIsno() {
		return this.isno;
	}

	public void setIsno(Boolean isno) {
		this.isno = isno;
	}

	@Column(name = "INHERIT", precision = 1, scale = 0)
	public Boolean getInherit() {
		return this.inherit;
	}

	public void setInherit(Boolean inherit) {
		this.inherit = inherit;
	}

}